using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;

namespace NetworkPower.DataModel.Models.Mapping
{
    public class SeperatorTypeMap : EntityTypeConfiguration<SeperatorType>
    {
        public SeperatorTypeMap()
        {
            // Primary Key
            this.HasKey(t => t.SeperatorTypeID);

            // Properties
            this.Property(t => t.SeperatorValue)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.VoltageID).IsOptional();

            // Table & Column Mappings
            this.ToTable("SeperatorTypes");
            this.Property(t => t.SeperatorTypeID).HasColumnName("SeperatorTypeID");
            this.Property(t => t.SeperatorValue).HasColumnName("SeperatorValue");
            this.Property(t => t.VoltageID).HasColumnName("VoltageID");

        }
    }
}
